import { roomCostStrategyOfCreepNormal } from "./CostStrategy/roomCostStrategyOfCreepNormal";
import { roomCostStrategyOfSafe } from "./CostStrategy/roomCostStrategyOfSafe";
import { roomCostStrategyOfTeam4 } from "./CostStrategy/roomCostStrategyOfTeam4"
import { roomCostStrategyOfTeam4DestoryStructure } from "./CostStrategy/roomCostStrategyOfTeam4DestoryStructure";

export interface PathCostType
{
    roomCostStrategyOfTeam4:roomCostStrategyOfTeam4,
    roomCostStrategyOfSafe:roomCostStrategyOfSafe,
    roomCostStrategyOfCreepNormal:roomCostStrategyOfCreepNormal,
    roomCostStrategyOfTeam4DestoryStructure:roomCostStrategyOfTeam4DestoryStructure
}
export type CostTypes = keyof PathCostType
export class CostStrategyManager
{
    private static costStrategy:Record<CostTypes,PathCostType[CostTypes]>;
    static init()
    {
        this.costStrategy={
            roomCostStrategyOfTeam4:new roomCostStrategyOfTeam4(),
            roomCostStrategyOfSafe:new roomCostStrategyOfSafe(),
            roomCostStrategyOfCreepNormal:new roomCostStrategyOfCreepNormal(),
            roomCostStrategyOfTeam4DestoryStructure:new roomCostStrategyOfTeam4DestoryStructure()
        }
    }

    /**
     * 根据类型
     * @param type 
     * @param roomName 
     */
    static getPathCost(type:CostTypes,roomName:string)
    {
       return  this.costStrategy[type].getCost(roomName);
    }

}


 